package com.gzhryc.shared_device.oem.micro.api.controllers.xcx.v1.bxscn;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.gzhryc.common.DateTools;
import com.gzhryc.common.NumberTools;
import com.gzhryc.common.StringTools;
import com.gzhryc.common.config.PropertyTools;
import com.gzhryc.common.gps.GPSDistance;
import com.gzhryc.common.json.JsonTools;
import com.gzhryc.servlet.WebUtils;
import com.gzhryc.servlet.annotation.Route;
import com.gzhryc.shared_device.bxscn.code.dao.db.BXSCNBatteryTypeDayCost;
import com.gzhryc.shared_device.bxscn.code.dao.db.BXSCNShopFeeTemplateItem;
import com.gzhryc.shared_device.bxscn.code.dao.db.PortableEnergyBatteryType;
import com.gzhryc.shared_device.bxscn.code.dao.enums.BXSCNShopFeeTemplateItemEnum;
import com.gzhryc.shared_device.bxscn.code.dao.enums.PortableEnergyBatteryEnum;
import com.gzhryc.shared_device.bxscn.code.dao.models.BXSCNBatteryTypeDayMoneyContent;
import com.gzhryc.shared_device.bxscn.code.dao.models.PortableEnergyBatteryPlaceCount;
import com.gzhryc.shared_device.bxscn.code.dao.models.PortableEnergyBatteryTypeCount;
import com.gzhryc.shared_device.bxscn.code.services.BXSCNBatteryTypeDayCostService;
import com.gzhryc.shared_device.bxscn.code.services.BXSCNShopFeeTemplateService;
import com.gzhryc.shared_device.bxscn.code.services.PortableEnergyBatteryService;
import com.gzhryc.shared_device.bxscn.code.services.PortableEnergyBatteryTypeService;
import com.gzhryc.shared_device.bxscn.code.services.dto.PortableEnergyBatteryTypeSearch;
import com.gzhryc.shared_device.oem.code.business.EBusinessType;
import com.gzhryc.shared_device.oem.code.member.LoginMember;
import com.gzhryc.shared_device.oem.code.place.dao.db.PlaceBusinessConfig;
import com.gzhryc.shared_device.oem.code.place.dao.db.PlaceFreeMember;
import com.gzhryc.shared_device.oem.code.place.dao.db.PlacePhysicalStore;
import com.gzhryc.shared_device.oem.code.place.dao.db.PlacePhysicalStoreAddress;
import com.gzhryc.shared_device.oem.code.place.services.PlaceBusinessConfigService;
import com.gzhryc.shared_device.oem.code.place.services.PlaceFreeMemberService;
import com.gzhryc.shared_device.oem.code.place.services.PlacePhysicalStoreAddressService;
import com.gzhryc.shared_device.oem.code.place.services.PlacePhysicalStoreService;
import com.gzhryc.shared_device.oem.micro.api.MicroConstants;
import com.gzhryc.shared_device.oem.micro.api.PlaceGPSServiceManager;
import com.gzhryc.shared_device.oem.micro.api.dto.xcx.ClientAPICodeConstants;
import com.gzhryc.shared_device.oem.micro.api.dto.xcx.v1.bxscn.BXSCNBatteryTypeInfoRequest;
import com.gzhryc.shared_device.oem.micro.api.dto.xcx.v1.bxscn.BXSCNBatteryTypeInfoResponse;
import com.gzhryc.shared_device.oem.micro.api.dto.xcx.v1.bxscn.BXSCNBatteryTypeListRequest;
import com.gzhryc.shared_device.oem.micro.api.dto.xcx.v1.bxscn.BXSCNBatteryTypeListResponse;
import com.gzhryc.shared_device.oem.micro.api.dto.xcx.v1.bxscn.BXSCNBatteryTypeShopFindRequest;
import com.gzhryc.shared_device.oem.micro.api.dto.xcx.v1.bxscn.BXSCNBatteryTypeShopFindResponse;
import com.gzhryc.shared_device.oem.micro.api.dto.xcx.v1.bxscn.BXSCNShopLeasePriceRequest;
import com.gzhryc.shared_device.oem.micro.api.dto.xcx.v1.bxscn.BXSCNShopLeasePriceResponse;
import com.gzhryc.shared_device.oem.micro.api.dto.xcx.v1.bxscn.BXSCNShopScanInfoRequest;
import com.gzhryc.shared_device.oem.micro.api.dto.xcx.v1.bxscn.BXSCNShopScanInfoResponse;

public class BXSCNShopScanController {

    /**
     * 扫码门店二维码
     * @param request
     * @return
     */
    @Route(value = { "/xcx/v1/bxscn/shop/scan/get.do" }, method = "POST")
    public BXSCNShopScanInfoResponse getSharedDevice(HttpServletRequest request) {
        BXSCNShopScanInfoResponse apiResp = new BXSCNShopScanInfoResponse(ClientAPICodeConstants.NULL_DATA, "未找到网点信息");
        BXSCNShopScanInfoRequest apiReq = WebUtils.getJsonRequest(request, BXSCNShopScanInfoRequest.class);
        if (apiReq != null && apiReq.getBody().getPlaceId() != null) {
            PlacePhysicalStore physicalStore = PlacePhysicalStoreService.self().getById(apiReq.getBody().getPlaceId());
            if(physicalStore != null){
                apiResp.setCode(ClientAPICodeConstants.SUCCESS,null);
                apiResp.getBody().setPlaceId(physicalStore.getId());
                apiResp.getBody().setPlaceName(physicalStore.getName());
                apiResp.getBody().setAddress(physicalStore.getFullAddress());

                List<String> ids = PortableEnergyBatteryService.self().findBatteryTypeByPlaceId(physicalStore.getId());
                if(ids != null && ids.size() > 0){
                    List<PortableEnergyBatteryType> batteryTypeList = PortableEnergyBatteryTypeService.self().findByIds(ids);
                    if(batteryTypeList != null && batteryTypeList.size() > 0){
                        apiResp.getBody().setItems(new ArrayList<>());
                        String resDomain = PropertyTools.get().getString("resDomain");
                        for(PortableEnergyBatteryType batteryType : batteryTypeList){
                            BXSCNShopScanInfoResponse.Item item = new BXSCNShopScanInfoResponse.Item();
                            item.setId(batteryType.getId());
                            item.setName(batteryType.getName());
                            item.setThumbnailImg(WebUtils.setHttpDomain(resDomain,batteryType.getThumbnailImg()));
                            apiResp.getBody().getItems().add(item);
                        }
                    }
                }
            }
        }
        return apiResp;
    }

    @Route(value = { "/xcx/v1/bxscn/battery_type/find.data" }, method = "POST")
    public BXSCNBatteryTypeListResponse findBatteryTypeList(HttpServletRequest request){
        BXSCNBatteryTypeListResponse apiResp = new BXSCNBatteryTypeListResponse(ClientAPICodeConstants.NULL_DATA, "未找到设备类型信息");
        BXSCNBatteryTypeListRequest apiReq = WebUtils.getJsonRequest(request, BXSCNBatteryTypeListRequest.class);
        if (apiReq != null) {
            PortableEnergyBatteryTypeSearch search = new PortableEnergyBatteryTypeSearch();
            List<PortableEnergyBatteryType> batteryTypeList = PortableEnergyBatteryTypeService.self().findBySearch(search,apiReq.getBody().getPageNo()
                    ,apiReq.getBody().getPageLimit());
            if(batteryTypeList != null && batteryTypeList.size() > 0){
                apiResp.setCode(ClientAPICodeConstants.SUCCESS,null);
                apiResp.getBody().setItems(new ArrayList<>());
                String resDomain = PropertyTools.get().getString("resDomain");

                List<String> typeIds = new ArrayList<>();
                for(PortableEnergyBatteryType batteryType : batteryTypeList){
                    typeIds.add(batteryType.getId());
                }
                List<PortableEnergyBatteryTypeCount> typeCountList  = PortableEnergyBatteryService.self()
                        .findTypeCountByStateAndTypeIds(PortableEnergyBatteryEnum.State.Charging.index(),typeIds);

                List<BXSCNBatteryTypeDayCost> batteryTypeDayCostList = BXSCNBatteryTypeDayCostService.self().findByTypeIds(typeIds);

                for(PortableEnergyBatteryType batteryType : batteryTypeList){
                    BXSCNBatteryTypeListResponse.Item item = new BXSCNBatteryTypeListResponse.Item();
                    item.setId(batteryType.getId());
                    item.setName(batteryType.getName());
                    item.setThumbnailImg(WebUtils.setHttpDomain(resDomain,batteryType.getThumbnailImg()));
                    item.setBatteryPower(batteryType.getBatteryPower());
                    item.setStockCount(0L);

                    if(typeCountList != null && typeCountList.size() > 0){
                        for(PortableEnergyBatteryTypeCount typeCount : typeCountList){
                            if(typeCount.getBatteryType().equals(item.getId())){
                                item.setStockCount(typeCount.getDeviceCount());
                                break;
                            }
                        }
                    }

                    if(batteryTypeDayCostList != null && batteryTypeDayCostList.size() > 0){
                        for(BXSCNBatteryTypeDayCost bxscnBatteryTypeDayCost : batteryTypeDayCostList){
                            if(bxscnBatteryTypeDayCost.getTypeId().equals(item.getId())){
                                item.setDepositMoney(bxscnBatteryTypeDayCost.getDepositMoneyStr());
                                item.setMoney(bxscnBatteryTypeDayCost.getDayMoneyStr());
                                break;
                            }
                        }
                    }
                    apiResp.getBody().getItems().add(item);
                }
            }
        }
        return apiResp;
    }

    @Route(value = { "/xcx/v1/bxscn/battery_type/info.data" }, method = "POST")
    public BXSCNBatteryTypeInfoResponse getBatteryTypeInfo(HttpServletRequest request){
        BXSCNBatteryTypeInfoResponse apiResp = new BXSCNBatteryTypeInfoResponse(ClientAPICodeConstants.NULL_DATA, "未找到设备类型信息");
        BXSCNBatteryTypeInfoRequest apiReq = WebUtils.getJsonRequest(request, BXSCNBatteryTypeInfoRequest.class);
        LoginMember loginMember = WebUtils.getAttribute(request, MicroConstants.ATTR_LOGIN_MEMBER, LoginMember.class);
        if (apiReq != null && StringTools.isNotBlank(apiReq.getBody().getBatteryType()) && loginMember != null){
            PortableEnergyBatteryType batteryType = PortableEnergyBatteryTypeService.self().getById(apiReq.getBody().getBatteryType());
            if(batteryType != null){
                apiResp.setCode(ClientAPICodeConstants.SUCCESS,null);
                String resDomain = PropertyTools.get().getString("resDomain");
                apiResp.getBody().setId(batteryType.getId());
                apiResp.getBody().setName(batteryType.getName());
                apiResp.getBody().setThumbnailImg(WebUtils.setHttpDomain(resDomain,batteryType.getThumbnailImg()));
                apiResp.getBody().setBatteryPower(batteryType.getBatteryPower());

                if(StringTools.isNotBlank(batteryType.getImages())){
                    String[] images = batteryType.getImages().split("\\|");
                    if(images != null && images.length > 0){
                        apiResp.getBody().setImages(new ArrayList<>());
                        for(String item : images){
                            apiResp.getBody().getImages().add(WebUtils.setHttpDomain(resDomain,item));
                        }
                    }
                }
                
                BXSCNShopFeeTemplateItem templateItem = null;
                
                Integer type = BXSCNShopFeeTemplateItemEnum.Type.Normal.index();
            	Integer depositMoney = null;
            	Integer dayMoney = null;
            	BXSCNBatteryTypeDayMoneyContent dayMoneyContent = null;

                //白名单检查
                PlaceFreeMember freeMember = PlaceFreeMemberService.self().getByKeys(apiReq.getBody().getPlaceId(), loginMember.getPhone());
                if(freeMember != null ) {
                	//自动激活
                	if(freeMember.getMemberId() == null) {
                		PlaceFreeMemberService.self().bindMember(freeMember.getPlaceId(),freeMember.getPhone(), loginMember.getId(), loginMember.getPhone());
                	}
                	type = BXSCNShopFeeTemplateItemEnum.Type.FreeMember.index();
                }

                //检查白名单价格
                PlaceBusinessConfig placeBusiConfig = PlaceBusinessConfigService.self().getByKeys(apiReq.getBody().getPlaceId(),
            			EBusinessType.BXSCN_SHOP.index());
                if(placeBusiConfig != null && placeBusiConfig.getFeeTemplateId() != null) {
                	templateItem = BXSCNShopFeeTemplateService.self().getItemByAvailable(placeBusiConfig.getFeeTemplateId(), batteryType.getId(), type);
                }
                
                if(templateItem != null) {
                	depositMoney = templateItem.getDepositMoney();
               	 	dayMoney = templateItem.getDayMoney();
               	 
               	 	if (StringTools.isNotBlank(templateItem.getDayMoneyContent())) {
               	 		dayMoneyContent = JsonTools.fromJson(templateItem.getDayMoneyContent(), BXSCNBatteryTypeDayMoneyContent.class);
               	 	}
                }else {
                	BXSCNBatteryTypeDayCost batteryTypeDayCost = BXSCNBatteryTypeDayCostService.self().getByTypeId(apiReq.getBody().getBatteryType());
                    if(batteryTypeDayCost != null){
                    	depositMoney = batteryTypeDayCost.getDepositMoney();
                   	 	dayMoney = batteryTypeDayCost.getDayMoney();
                   	 
                   	 	if (StringTools.isNotBlank(batteryTypeDayCost.getDayMoneyContent())) {
                   	 		dayMoneyContent = JsonTools.fromJson(batteryTypeDayCost.getDayMoneyContent(), BXSCNBatteryTypeDayMoneyContent.class);
                   	 	}
                    }
                }
                
                if(depositMoney != null && dayMoney != null){
                    apiResp.getBody().setDepositMoney(NumberTools.getMoneyStr(depositMoney));
                    apiResp.getBody().setDayMoney(NumberTools.getMoneyStr(dayMoney));
                    if(dayMoneyContent != null) {
                        apiResp.getBody().setDayMoneyContent(dayMoneyContent);
                    }
                }else{
                    apiResp.setMsg("未设置租借费用");
                }
            }
        }
        return apiResp;
    }

    @Route(value = { "/xcx/v1/bxscn/battery_type/shop/find.data" }, method = "POST")
    public BXSCNBatteryTypeShopFindResponse findBatteryTypeShopList(HttpServletRequest request) {
        BXSCNBatteryTypeShopFindResponse apiResp = new BXSCNBatteryTypeShopFindResponse(ClientAPICodeConstants.NULL_DATA, "未找到网点信息");
        BXSCNBatteryTypeShopFindRequest apiReq = WebUtils.getJsonRequest(request, BXSCNBatteryTypeShopFindRequest.class);
        if (apiReq != null && StringTools.isNotBlank(apiReq.getBody().getBatteryType())) {
            List<Long> placeIds = PortableEnergyBatteryService.self().findPlaceIdByBatteryTypeAndLeaseType(apiReq.getBody().getBatteryType(),
                    PortableEnergyBatteryEnum.LeaseType.ShopService.index(), apiReq.getBody().getPageNo(),apiReq.getBody().getPageLimit());

            if(placeIds != null && placeIds.size() > 0){
                List<PlacePhysicalStore> placePhysicalStoreList = PlacePhysicalStoreService.self().findByIds(placeIds);
                if(placePhysicalStoreList != null && placePhysicalStoreList.size() > 0){
                    apiResp.setCode(ClientAPICodeConstants.SUCCESS, null);
                    apiResp.getBody().setItems(new ArrayList<>());

                    //获取每个网点可租借的电池数量
                    List<PortableEnergyBatteryPlaceCount> placeCountList = PortableEnergyBatteryService.self()
                            .findPlaceCountByStateAndTypeIdAndPlaceIds(PortableEnergyBatteryEnum.State.Charging.index(),apiReq.getBody().getBatteryType(),placeIds);

                    String resDomain = PropertyTools.get().getString("resDomain");

                    List<PlacePhysicalStoreAddress> addressList = PlacePhysicalStoreAddressService.self().findByIds(placeIds);
                    if(apiReq.getBody().getLatitude() != null && apiReq.getBody().getLongitude() != null){
                        List<GPSDistance> gpsDistanceList = PlaceGPSServiceManager.self().getLocationService().findByGPS(apiReq.getBody().getLatitude()
                                ,apiReq.getBody().getLongitude(),placeIds);
                        if(gpsDistanceList != null && gpsDistanceList.size() > 0){
                            //存在GPS，则按远近排序
                            for(GPSDistance gpsDistance : gpsDistanceList){
                                PlacePhysicalStore physicalStore = null;
                                int index = -1;
                                for (int i = 0;i<placePhysicalStoreList.size();i++) {
                                    PlacePhysicalStore temp = placePhysicalStoreList.get(i);
                                    if (temp.getId().equals(gpsDistance.getId())) {
                                        physicalStore = temp;
                                        index = i;
                                        break;
                                    }
                                }

                                if(physicalStore != null) {
                                    BXSCNBatteryTypeShopFindResponse.Item item = new BXSCNBatteryTypeShopFindResponse.Item();
                                    item.setPlaceId(physicalStore.getId());
                                    item.setPlaceName(physicalStore.getName());
                                    item.setThumbnailImg(WebUtils.setHttpDomain(resDomain,physicalStore.getThumbnailImg()));
                                    item.setProvince(physicalStore.getProvince());
                                    item.setAddress(physicalStore.getAddress());
                                    item.setRouteInfo(physicalStore.getRouteInfo());
                                    item.setContactPhone(physicalStore.getContactPhone());      //联系电话
                                    if (physicalStore.getOpenTime() != null && physicalStore.getCloseTime() != null) {
                                        item.setWorkTimes(DateTools.changeHHmm(physicalStore.getOpenTime()) + "-" + DateTools.changeHHmm(physicalStore.getCloseTime()));
                                    }
                                    if (addressList != null && addressList.size() > 0) {
                                        for (PlacePhysicalStoreAddress address : addressList) {
                                            item.setReceiveName(address.getReceiveName());
                                            item.setReceivePhone(address.getReceivePhone());
                                            item.setMailAddress(address.getAddress());
                                            break;
                                        }
                                    }
                                    item.setDistance(gpsDistance.getDistance());
                                    item.setStockCount(0L);
                                    if(placeCountList != null && placeCountList.size() > 0){
                                        for(PortableEnergyBatteryPlaceCount placeCount : placeCountList){
                                            if(placeCount.getPlaceId().equals(item.getPlaceId())){
                                                item.setStockCount(placeCount.getDeviceCount());
                                                break;
                                            }
                                        }
                                    }
                                    apiResp.getBody().getItems().add(item);

                                    if(index > -1){
                                        placePhysicalStoreList.remove(index);
                                    }
                                }
                            }
                        }
                    }

                    for (PlacePhysicalStore physicalStore : placePhysicalStoreList) {
                        BXSCNBatteryTypeShopFindResponse.Item item = new BXSCNBatteryTypeShopFindResponse.Item();
                        item.setPlaceId(physicalStore.getId());
                        item.setPlaceName(physicalStore.getName());
                        item.setThumbnailImg(WebUtils.setHttpDomain(resDomain,physicalStore.getThumbnailImg()));
                        item.setProvince(physicalStore.getProvince());
                        item.setAddress(physicalStore.getAddress());
                        item.setRouteInfo(physicalStore.getRouteInfo());
                        item.setContactPhone(physicalStore.getContactPhone());      //联系电话
                        if (physicalStore.getOpenTime() != null && physicalStore.getCloseTime() != null) {
                            item.setWorkTimes(DateTools.changeHHmm(physicalStore.getOpenTime()) + "-" + DateTools.changeHHmm(physicalStore.getCloseTime()));
                        }
                        if (addressList != null && addressList.size() > 0) {
                            for (PlacePhysicalStoreAddress address : addressList) {
                                item.setReceiveName(address.getReceiveName());
                                item.setReceivePhone(address.getReceivePhone());
                                item.setMailAddress(address.getAddress());
                                break;
                            }
                        }
                        item.setStockCount(0L);
                        if(placeCountList != null && placeCountList.size() > 0){
                            for(PortableEnergyBatteryPlaceCount placeCount : placeCountList){
                                if(placeCount.getPlaceId().equals(item.getPlaceId())){
                                    item.setStockCount(placeCount.getDeviceCount());
                                    break;
                                }
                            }
                        }
                        apiResp.getBody().getItems().add(item);
                    }
                }
            }
        }
        return apiResp;
    }

    @Route(value = { "/xcx/v1/bxscn/battery_type/price.data" }, method = "POST")
    public BXSCNShopLeasePriceResponse price(HttpServletRequest request){
        BXSCNShopLeasePriceResponse apiResp = new BXSCNShopLeasePriceResponse(ClientAPICodeConstants.NULL_DATA, "未找到租借费用配置");
        BXSCNShopLeasePriceRequest apiReq = WebUtils.getJsonRequest(request, BXSCNShopLeasePriceRequest.class);
        LoginMember loginMember = WebUtils.getAttribute(request, MicroConstants.ATTR_LOGIN_MEMBER, LoginMember.class);
        if (apiReq != null && apiReq.getBody().getPlaceId() != null && StringTools.isNotBlank(apiReq.getBody().getBatteryType())
        		&& loginMember != null){
        	if(apiReq.getBody().getLeaseDay() == null){
                apiResp.setCode(ClientAPICodeConstants.EXECUTE_ERROR,"缺少租借天数");
                return apiResp;
            }
        	
        	BXSCNShopFeeTemplateItem templateItem = null;
            
            Integer type = BXSCNShopFeeTemplateItemEnum.Type.Normal.index();
        	Integer depositMoney = null;
        	Integer dayMoney = null;
        	BXSCNBatteryTypeDayMoneyContent dayMoneyContent = null;

            //白名单检查
            PlaceFreeMember freeMember = PlaceFreeMemberService.self().getByKeys(apiReq.getBody().getPlaceId(), loginMember.getPhone());
            if(freeMember != null ) {
            	//自动激活
            	if(freeMember.getMemberId() == null) {
            		PlaceFreeMemberService.self().bindMember(freeMember.getPlaceId(),freeMember.getPhone(), loginMember.getId(), loginMember.getPhone());
            	}
            	type = BXSCNShopFeeTemplateItemEnum.Type.FreeMember.index();
            }

            //检查白名单价格
            PlaceBusinessConfig placeBusiConfig = PlaceBusinessConfigService.self().getByKeys(apiReq.getBody().getPlaceId(),
        			EBusinessType.BXSCN_SHOP.index());
            if(placeBusiConfig != null && placeBusiConfig.getFeeTemplateId() != null) {
            	templateItem = BXSCNShopFeeTemplateService.self().getItemByAvailable(placeBusiConfig.getFeeTemplateId()
            			, apiReq.getBody().getBatteryType(), type);
            }
            
            if(templateItem != null) {
            	depositMoney = templateItem.getDepositMoney();
           	 	dayMoney = templateItem.getDayMoney();
           	 
           	 	if (StringTools.isNotBlank(templateItem.getDayMoneyContent())) {
           	 		dayMoneyContent = JsonTools.fromJson(templateItem.getDayMoneyContent(), BXSCNBatteryTypeDayMoneyContent.class);
           	 	}
            }else {
            	BXSCNBatteryTypeDayCost batteryTypeDayCost = BXSCNBatteryTypeDayCostService.self().getByTypeId(apiReq.getBody().getBatteryType());
                if(batteryTypeDayCost != null){
                	depositMoney = batteryTypeDayCost.getDepositMoney();
               	 	dayMoney = batteryTypeDayCost.getDayMoney();
               	 
               	 	if (StringTools.isNotBlank(batteryTypeDayCost.getDayMoneyContent())) {
               	 		dayMoneyContent = JsonTools.fromJson(batteryTypeDayCost.getDayMoneyContent(), BXSCNBatteryTypeDayMoneyContent.class);
               	 	}
                }
            }
            
            if (dayMoneyContent != null && dayMoneyContent.getItems() != null && dayMoneyContent.getItems().size() > 0) {
                for (BXSCNBatteryTypeDayMoneyContent.Item item : dayMoneyContent.getItems()) {
                    if (item.getLeaseDay() <= apiReq.getBody().getLeaseDay()) {
                        dayMoney = item.getMoney();
                    } else {
                        break;
                    }
                }
            }
            
            if(depositMoney != null && dayMoney != null) {
        		//计算费用
        		Integer payMoney = depositMoney + (dayMoney * apiReq.getBody().getLeaseDay());
      
        		apiResp.setCode(ClientAPICodeConstants.SUCCESS,null);
                apiResp.getBody().setMoney(NumberTools.getMoneyStr(payMoney));
                apiResp.getBody().setDayMoney(NumberTools.getMoneyStr(dayMoney));
                apiResp.getBody().setDepositMoney(NumberTools.getMoneyStr(depositMoney));
        	}
        	
        }
        return apiResp;
    }

}
